package com.qfedu.meidijiaju.service.impl;

import com.qfedu.meidijiaju.common.ResponseData;
import com.qfedu.meidijiaju.entity.ShiputypeYxy;
import com.qfedu.meidijiaju.mapper.ShiputypeYxyMapper;
import com.qfedu.meidijiaju.service.ShiputypeYxyService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 食谱类型 服务实现类
 * </p>
 *
 * @author meidimeiju
 * @since 2022-10-05
 */
@Service
public class ShiputypeYxyServiceImpl extends ServiceImpl<ShiputypeYxyMapper, ShiputypeYxy> implements ShiputypeYxyService {

    @Autowired
    private ShiputypeYxyMapper shiputypeYxyMapper;

    @Override
    public ResponseData<ShiputypeYxy> queryShuPuTypeId(int shiputypeId) {

        ResponseData<ShiputypeYxy> responseData = new ResponseData<>();

        ShiputypeYxy shiputypeYxyList = shiputypeYxyMapper.queryShuPuTypeId(shiputypeId);

        if (shiputypeYxyList != null){

            responseData.setCode(200);

            responseData.setData(shiputypeYxyList);

        } else {

            responseData.setCode(400);

            responseData.setMsg("无数据！");
        }

        return responseData;
    }
}
